﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Click Test</title>
</head>
<body>
    <div id="div1" style="height:100px;width:100px;background-color:Red;">
        <div id="div2" style="height:50px;width:50px;background-color:Blue;"></div>
    </div>

    <script type="text/javascript">

        function ClickParent(e) {
            var evt = (typeof(e) != "undefined") ? e : window.event;

            alert("parent click");
        }

        function ClickChild(e) {
            var evt = (typeof(e) != "undefined") ? e : window.event;

            alert("child click");
        }

        document.getElementById("div1").onmousedown = ClickParent;
        document.getElementById("div2").onmousedown = ClickChild;

    </script>
</body>
</html>
